package com.uzai.console.web.groupcarddata;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.groupcarddata.BatchSetAddFanGroupDto;
import com.uzai.console.dto.groupcarddata.FindAddFanGroupDto;
import com.uzai.console.dto.groupcarddata.SetAddFanGroupDto;
import com.uzai.console.service.groupcarddata.GroupCardDataService;
import com.uzai.console.vo.groupcarddata.FindAddFanGroupVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 群卡片数据
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "群卡片数据",tags = "群卡片数据")
@ApiSort(100)
@RestController
public class GroupCardDataController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(GroupCardDataController.class);

    @Autowired
    private GroupCardDataService groupCardDataService;

    @ApiOperation(value = "群卡片数据查询当前进粉群", notes = "群卡片数据查询当前进粉群", response = FindAddFanGroupVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/groupCardData/addFanGroup/find")
    public Object findAddFanGroup(@RequestBody FindAddFanGroupDto findAddFanGroupDto){
        return groupCardDataService.findAddFanGroup(findAddFanGroupDto);
    }

    @ApiOperation(value = "群卡片数据设置当前进粉群", notes = "群卡片数据设置当前进粉群", response = Boolean.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/groupCardData/addFanGroup/set")
    public Object setAddFanGroup(@RequestBody SetAddFanGroupDto setAddFanGroupDto){
        groupCardDataService.setAddFanGroup(setAddFanGroupDto);
        return true;
    }

    @ApiOperation(value = "群卡片数据批量设置当前进粉群", notes = "群卡片数据批量设置当前进粉群", response = Boolean.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("groupCardData/addFanGroup/set/batch")
    public Object setAddFanGroup(@RequestBody BatchSetAddFanGroupDto batchSetAddFanGroupDto){
        groupCardDataService.batchSetAddFanGroup(batchSetAddFanGroupDto);
        return true;
    }


}
